package com.ruoyi.office.asset.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import lombok.RequiredArgsConstructor;
import com.ruoyi.office.asset.mapper.AssetLocationMapper;
import com.ruoyi.office.asset.domain.AssetLocation;
import com.ruoyi.office.asset.request.AssetLocationQueryDto;
import com.ruoyi.office.asset.service.IAssetLocationService;

/**
 * 资产位置服务实现类
 * 
 * @author tqfeiyang
 * @date 2024-12-06
 */
@Service
@RequiredArgsConstructor
public class AssetLocationServiceImpl implements IAssetLocationService 
{
    private final AssetLocationMapper assetLocationMapper;

    /**
     * 查询资产位置列表
     *
     * @param criteria 查询条件
     * @return 资产位置列表
     */
    @Override
    public List<AssetLocation> selectAssetLocationList(AssetLocationQueryDto criteria)
    {
        return assetLocationMapper.selectAssetLocationList(criteria);
    }

    /**
     * 查询资产位置
     * 
     * @param id 资产位置主键
     * @return 资产位置
     */
    @Override
    public AssetLocation selectAssetLocationById(Integer id)
    {
        return assetLocationMapper.selectAssetLocationById(id);
    }

    /**
     * 新增资产位置
     * 
     * @param assetLocation 资产位置
     * @return 结果
     */
    @Override
    @Transactional
    public int insertAssetLocation(AssetLocation assetLocation)
    {
        return assetLocationMapper.insertAssetLocation(assetLocation);
    }

    /**
     * 修改资产位置
     * 
     * @param assetLocation 资产位置
     * @return 结果
     */
    @Override
    @Transactional
    public int updateAssetLocation(AssetLocation assetLocation)
    {
        return assetLocationMapper.updateAssetLocation(assetLocation);
    }

    /**
     * 删除资产位置信息
     *
     * @param id 资产位置主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteAssetLocationById(Integer id)
    {
        return assetLocationMapper.deleteAssetLocationById(id);
    }

    /**
     * 批量删除资产位置
     * 
     * @param ids 需要删除的资产位置主键
     * @return 结果
     */
    @Override
    public int deleteAssetLocationByIds(Integer[] ids)
    {
        return assetLocationMapper.deleteAssetLocationByIds(ids);
    }
}
